package com.project806;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.dylanvann.fastimage.FastImageViewPackage;
import cn.qiuxiang.react.geolocation.AMapGeolocationPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.theweflex.react.WeChatPackage;
import com.reactnativecommunity.webview.RNCWebViewPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.project806.Module.CustomPackage;
import com.syanpicker.RNSyanImagePickerPackage;
import com.horcrux.svg.SvgPackage;
import com.beefe.picker.PickerViewPackage;
import com.imagepicker.ImagePickerPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.rnfs.RNFSPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
            return BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(
                    new MainReactPackage(),
            new FastImageViewPackage(),
            new AMapGeolocationPackage(),
            new ReactVideoPackage(),
            new WeChatPackage(),
            new RNCWebViewPackage(),
                    new VectorIconsPackage(),
                    new RNSyanImagePickerPackage(),
                    new SvgPackage(),
                    new PickerViewPackage(),
                    new ImagePickerPackage(),
                    new RNGestureHandlerPackage(),
                    new RNFSPackage(),
                    new RNFetchBlobPackage(),
                    new AsyncStoragePackage(),
                    new CustomPackage()
            );
        }

        @Override
        protected String getJSMainModuleName() {
            return "index";
        }
    };

    @Override
    public ReactNativeHost getReactNativeHost() {
        return mReactNativeHost;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        SoLoader.init(this, /* native exopackage */ false);
    }
}
